package sctu.edu.java.year2016.team06.luoxin.day20160616;

/**用switch语句编写一个完成两个整数四则运算的程序。
 * Created by Administrator on 2016/6/16.
 */
import java.util.Scanner;
public class arithmetic {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.println("请输入两个整数：");
        int a= s.nextInt();
        int b=s.nextInt();
        for(int i=1;i<5;i++){
                    switch(i){
                case 1:
                    System.out.println("两个数和的值为："+(a+b));
                    break;
                case 2:
                    System.out.println("两个数的乘积的值为："+(a*b));
                    break;
                case 3:
                    System.out.println("两个数的商的值为："+(a/b));
                    break;
                case 4:
                    System.out.println("两个数的差的值为："+(a-b));
                    break;
                default:
                    System.out.println("i值输入错误！");
            }
        }
    }
}
